<template>
  <view class="box train">
    <view class="box-title">{{ titleName }}</view>
    <view
      class="box-item"
      v-for="trainItem in awardArr"
      :key="trainItem.person_awardId"
    >
      <view class="item-title">
        <text class="icon icon-school"></text>
        <text>{{ trainItem.person_awardesc }}</text>
      </view>
      <view class="train-info">
        <view class="train-info-left">
          <text
            ><text class="divide"></text>{{ trainItem.person_awardate }}</text
          >
        </view>
        <!-- <view class="train-info-right">
          <text
            >{{ trainItem.train_startdate }}-{{
              trainItem.train_enddate || "至今"
            }}</text
          >
        </view> -->
      </view>
      <!-- <view class="des">
        <text>{{ trainItem.train_desc || "" }}</text>
      </view> -->
    </view>
  </view>
</template>

<script>
export default {
  props: {
    awardArr: {
      type: Array,
      default: () => [],
    },
    titleName: {
      type: String,
      default: "奖项荣誉",
    },
  },
};
</script>

<style lang="scss" scoped>
$img-base-resume: $img-base + "resume/";
.item-title {
  margin-bottom: $uni-spacing-col-lg;
  font-size: $uni-font-size-base;
  font-weight: bold;
  color: $uni-text-color-333;
}
.des {
  font-size: $uni-font-size-sm;
  line-height: 38rpx;
  color: $uni-text-color-999;
  white-space: pre-line;
  word-break: break-word;
}
.box {
  margin-bottom: $uni-spacing-col-big;
  padding: $uni-spacing-col-big;
  background-color: $uni-bg-color;
  border-radius: $uni-border-radius-lg;
  &-title {
    margin-bottom: $uni-spacing-col-lg;
    font-size: $uni-font-size-lg;
    font-weight: bold;
    color: #333333;
  }
  .icon {
    width: 36rpx;
    height: 36rpx;
    vertical-align: bottom;
  }
}
.train {
  &-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: $uni-spacing-col-lg;
    font-size: $uni-font-size-sm;
    &-left {
      color: $uni-text-color-333;
    }
    &-right {
      flex-shrink: 0;
      margin-left: 10rpx;
      color: $uni-text-color-999;
    }
  }
  .icon-school {
    background-image: url($img-base-resume + "school.png");
  }
}
</style>
